<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="./js/angular.min.js"></script>
<style type="text/css">
.red{color:red;}
</style>
</head>
<body ng-app="myApp" ng-controller="myAppController">

<p ng-class="{true:'red',false:'green'}[firstHover]">第一种</p>
<p ng-class="{red: secondHover == true}">第二种</p>
<p ng-class="{red: thredHover}">第三种</p>

</body>
<script type="text/javascript">
var myApp = angular.module('myApp',[]);
myApp.controller('myAppController',['$scope',function($scope){
	$scope.firstHover = true;
	$scope.secondHover = true;
	$scope.thredHover = true;
}]);
// 将类型等于 3 的进行隐藏
myApp.filter('addClass', function() {
    return function(showType) {
        if(showType == 3){
            return false;
        }else{
            return true;
        };
    }
});
</script>
</html>